package com.uam.core.entity.request;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;

/**
 * 公共的分页对象
 * @author heguanglong
 * @description
 * @date 2021-04-23
 */
public class ReqPageBase extends ApiReqCommon {

    @ApiModelProperty(name = "page_no", value = "当前页数",example = "1")
    @JsonProperty(value = "page_no" )
    private Integer pageNo;



    @ApiModelProperty(name = "page_size", value = "每页记录数量" ,example = "20")
    @JsonProperty(value = "page_size" )
    private Integer pageSize;

    public Integer getPageNo() {
        if (this.pageNo == null || pageNo <= 0) {
            pageNo = 1;
        }
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Integer getPageSize() {
        if (pageSize == null || pageSize <= 0) {
            pageSize = 20;
        }
        return pageSize;
    }
    @ApiModelProperty(hidden = true)
    public Integer getPageSizeDefault() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    @ApiModelProperty( value = "每页记录数量",hidden = true)
    public Integer getHistoryPageSize() {
        if (pageSize == null || pageSize <= 0) {
            pageSize = 50;
        }
        return pageSize;
    }
}
